package com.example.sbbsec.quartz.entity;

import com.google.common.base.MoreObjects;
import org.quartz.Scheduler;

import java.io.Serializable;
import java.util.Map;

import static com.example.sbbsec.quartz.util.QuartzConstant.EMPTY_STRING;
import static com.google.common.collect.Maps.newHashMap;

/**
 * 任务基础类
 *
 * @author lowe.yang
 * @date 2019-01-25 16:50
 */
public class Job implements Serializable {

    public Job() {
    }

    public Job(String jobName) {
        this.jobName = jobName;
    }

    //任务名称
    private String jobName;

    //任务分组
    private String jobGroup = Scheduler.DEFAULT_GROUP;

    //任务描述
    private String description = EMPTY_STRING;

    //任务自定义参数
    private Map<String, Object> data = newHashMap();

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("jobName", jobName)
                .add("jobGroup", jobGroup)
                .add("description", description)
                .add("data", data)
                .toString();
    }
}
